package com.foreveross.bsl.mam.rbac.application;

import java.util.List;

import javax.ws.rs.Consumes;
import javax.ws.rs.GET;
import javax.ws.rs.POST;
import javax.ws.rs.PUT;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.QueryParam;
import javax.ws.rs.core.MediaType;

import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;

import com.foreveross.bsl.mam.rbac.application.vo.OperationVO;

/**
 * <BR>
 * [功能详细描述]
 * 
 * @author Amberlo
 * @version [mam-application , 2013-6-27]
 */
@Path(value = "/operation")
public interface OperationApplication {
 
	@POST
	@Path("/add")
	@Produces({MediaType.APPLICATION_JSON })
	public OperationVO saveEntity(OperationVO entity);

	@PUT
	@Path("/update")
	@Produces({MediaType.APPLICATION_JSON })
	public OperationVO updateEntity(OperationVO entity);
	@POST
	@Path("/delete")
	@Produces({MediaType.APPLICATION_JSON })
	public void deleteEntity(OperationVO entity);

	@GET
	@Path("/get/{id}")
	@Produces({MediaType.APPLICATION_JSON })
	public OperationVO getEntity(@PathParam("id") String id);

	@GET
	@Path("/all")
	@Produces({MediaType.APPLICATION_JSON })
	public List<OperationVO> findAll();

	@POST
	@Path("/findAll")
	@Produces({MediaType.APPLICATION_JSON })
	@Consumes({ MediaType.APPLICATION_JSON})
	public Page<OperationVO> findByPageable(Pageable pageable);

	@GET
	@Path("/findByName")
	@Produces({MediaType.APPLICATION_JSON })
	public OperationVO getOperationByName(
			@QueryParam("operationName") String operationName);

	@POST
	@Path("/findByOperations")
	@Produces({MediaType.APPLICATION_JSON })
	public List<OperationVO> getOperations(List<String> ids);
}
